package com.fantasizegame.project.gen.entity;

import com.fantasizegame.project.gen.utils.StringUtils;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class ColumnEntity {

	private String	columnName;
	private String	type;
	private String	key;
	private String	defaultValue;

	public boolean arr() {
		return "[]".equals(defaultValue);
	}

	public boolean ai() {
		return "PRI".equals(key);
	}

	public String getFieldName() {
		return StringUtils.lineToHump(columnName);
	}

	public String getFieldType() {

		return switch (type) {
			case "int"				-> "Integer";
			case "varchar", "char"	-> "String";
			case "bigint"			-> "Long";
			case "tinyint"			-> "Boolean";
			default					-> "未知";
		};

	}

}
